/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.sisportaria.bean;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 *
 * @author lac
 */
@Entity
@Table(name = "MANUTENCAO")
@NamedQueries({@NamedQuery(name = "Manutencao.findAll", query = "SELECT m FROM Manutencao m"), @NamedQuery(name = "Manutencao.findByMtncodg", query = "SELECT m FROM Manutencao m WHERE m.mtncodg = :mtncodg"), @NamedQuery(name = "Manutencao.findByVtncodg", query = "SELECT m FROM Manutencao m WHERE m.vtncodg = :vtncodg"), @NamedQuery(name = "Manutencao.findByMtcdesc", query = "SELECT m FROM Manutencao m WHERE m.mtcdesc = :mtcdesc"), @NamedQuery(name = "Manutencao.findByMtddata", query = "SELECT m FROM Manutencao m WHERE m.mtddata = :mtddata"), @NamedQuery(name = "Manutencao.findByMtcofic", query = "SELECT m FROM Manutencao m WHERE m.mtcofic = :mtcofic"), @NamedQuery(name = "Manutencao.findByMtyvalr", query = "SELECT m FROM Manutencao m WHERE m.mtyvalr = :mtyvalr")})
public class Manutencao implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MTNCODG")
    private Integer mtncodg;
    @Column(name = "VTNCODG")
    private Integer vtncodg;
    @Column(name = "MTCDESC")
    private String mtcdesc;
    @Column(name = "MTDDATA")
    @Temporal(TemporalType.DATE)
    private Date mtddata;
    @Column(name = "MTCOFIC")
    private String mtcofic;
    @Column(name = "MTYVALR")
    private Double mtyvalr;

    public Manutencao() {
    }

    public Manutencao(Integer mtncodg) {
        this.mtncodg = mtncodg;
    }

    public Integer getMtncodg() {
        return mtncodg;
    }

    public void setMtncodg(Integer mtncodg) {
        Integer oldMtncodg = this.mtncodg;
        this.mtncodg = mtncodg;
        changeSupport.firePropertyChange("mtncodg", oldMtncodg, mtncodg);
    }

    public Integer getVtncodg() {
        return vtncodg;
    }

    public void setVtncodg(Integer vtncodg) {
        Integer oldVtncodg = this.vtncodg;
        this.vtncodg = vtncodg;
        changeSupport.firePropertyChange("vtncodg", oldVtncodg, vtncodg);
    }

    public String getMtcdesc() {
        return mtcdesc;
    }

    public void setMtcdesc(String mtcdesc) {
        String oldMtcdesc = this.mtcdesc;
        this.mtcdesc = mtcdesc;
        changeSupport.firePropertyChange("mtcdesc", oldMtcdesc, mtcdesc);
    }

    public Date getMtddata() {
        return mtddata;
    }

    public void setMtddata(Date mtddata) {
        Date oldMtddata = this.mtddata;
        this.mtddata = mtddata;
        changeSupport.firePropertyChange("mtddata", oldMtddata, mtddata);
    }

    public String getMtcofic() {
        return mtcofic;
    }

    public void setMtcofic(String mtcofic) {
        String oldMtcofic = this.mtcofic;
        this.mtcofic = mtcofic;
        changeSupport.firePropertyChange("mtcofic", oldMtcofic, mtcofic);
    }

    public Double getMtyvalr() {
        return mtyvalr;
    }

    public void setMtyvalr(Double mtyvalr) {
        Double oldMtyvalr = this.mtyvalr;
        this.mtyvalr = mtyvalr;
        changeSupport.firePropertyChange("mtyvalr", oldMtyvalr, mtyvalr);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mtncodg != null ? mtncodg.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Manutencao)) {
            return false;
        }
        Manutencao other = (Manutencao) object;
        if ((this.mtncodg == null && other.mtncodg != null) || (this.mtncodg != null && !this.mtncodg.equals(other.mtncodg))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.com.sisportaria.view.Manutencao[mtncodg=" + mtncodg + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
